<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../tpl/head.jsp"%>
<link rel="stylesheet" href="statics/css/searchform.css">
<link rel="stylesheet" href="statics/css/BasicData/customercenter.css">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layui-bg-cyan">
            <span>客户中心</span>
            <div class="titleright">
              <%-- <button class="layui-btn layui-btn-sm" id="customerstatistics">统计</button>--%>
               <%-- <button class="layui-btn layui-btn-sm" id="commonsettings">公共池设置</button>--%>
                  <button class="layui-btn layui-btn-sm" style="margin-right:1em;" lay-filter="customerstatistics"
                          lay-dropdown="{showBy: 'hover',align:'left', menus: [
                            <%--{txt: '业务员从公共池认领客户', event:'s1'},
                            {txt: '客户转入公共池详情表', event:'s2'},
                            {txt: '客户帐期详情', event:'s3'},--%>
                            {txt: '客户信息记录', event:'s4'},
                            {txt: '新客户账期详情', event:'S5'},
                            {txt: '客户下单出货记录', event:'S6'},
                        ]}">
                      <span>统计</span>
                      <i class="layui-icon layui-icon-triangle-d"></i>
                  </button>
            </div>
            <div class="titleright" style="position: absolute;right: 80px; width: 105px;display: none;" id="commonsettings">
                <button class="layui-btn layui-btn-sm" style="margin-right:1em;" lay-filter="commonsettings"
                        lay-dropdown="{showBy: 'hover',align:'left', menus: [
                            {txt: '未联系自动加入公共池', event:'s1'},
                            {txt: '联系未成单客户加入公共池', event:'s2'},
                            {txt: '距上次成单客户加入公共池', event:'s3'},
                        ]}">
                    <span>公共池设置</span>
                    <i class="layui-icon layui-icon-triangle-d"></i>
                </button>
            </div>
        </div>
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-tab layui-tab-card">
                        <ul class="layui-tab-title">
                            <li class="layui-this">客户查询</li>
                            <li class="">联系人查询</li>
                            <li class=""  id="khpool">公共客户池</li>
                        </ul>
                        <div class="layui-tab-content">
                            <%--查询条件--%>
                            <div class="layui-tab-item layui-show">
                                <div id="customertoolbar">
                                    <button class="layui-btn layui-btn-sm" data-type="getCheckData" lay-event="new" id="new">新增</button>
                                    <button class="layui-btn layui-btn-sm" lay-event="uploadFile" id="uploadFile">上传文件</button>
                                    <button class="layui-btn layui-btn-sm layui-btn-danger"  lay-event="delet" id="delet">删除</button>
                                    <button class="layui-btn layui-btn-sm layui-btn-danger"  lay-event="shared" id="sharedZhu">共享</button>
                                    <button class="layui-btn layui-btn-sm layui-btn-danger" id="print" style="margin-left: 10px" lay-event="print">打印</button>
                                    <button class="layui-btn layui-btn-sm layui-btn-danger" id="credit" style="margin-left: 10px" lay-event="credit">授信</button>

                                    <div class="layui-inline">
                                        <label class="layui-form-label">类型</label>
                                        <div class="layui-input-inline" style="width: 240px">
                                            <div id="cucustomerstype2" class="xm-select-demo"></div>
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label">所属业务员</label>
                                        <div class="layui-input-inline" style="width: 200px">
                                            <div id="salesman" class="xm-select-demo"></div>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">名称</label>
                                        <div class="layui-input-inline">
                                            <input class="text layui-input" type="text" name="cucustomers" id="cucustomers" autocomplete="off" placeholder="">
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <label class="layui-form-label">客户来源</label>
                                        <div class="layui-input-inline" style="width: 240px">
                                            <div id="sourceOfCustomers" class="xm-select-demo"></div>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">客户属性</label>
                                        <div class="layui-input-inline" style="width: 240px">
                                            <div id="attributesOfCustomers" class="xm-select-demo"></div>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">是否成单</label>
                                        <div class="layui-input-inline" style="width: 240px">
                                            <div id="isMaker" class="xm-select-demo"></div>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <button class="layui-btn layui-btn-sm" lay-event="searchs" style="margin-left: 10px" id="searchs">搜索</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="publicpool"  id="addpubpool">加入公共池</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="setUpCustomerCenter" id="setUpCustomerCenter">设置</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="updateSalesman" id="updateSalesman">转移</button>
                                    </div>
                                    <div class=" layui-col-md-4 text-right padding-top">


                                        <button class="layui-btn layui-btn-sm" lay-event="viewOffer" id="viewOffer">查看报价</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="viewContract" id="viewContract">查看外销</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="viewShipmentPlan" id="viewShipmentPlan">查看出运计划</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="viewShipmentDetail" id="viewShipmentDetail">查看出运明细</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="viewBillExchange" id="viewBillExchange">查看结汇</button>
                                        <button class="layui-btn layui-btn-sm" lay-event="viewEmail" id="viewEmail">邮件</button>
                                    </div>

                                </div>
                                <table class="layui-table" id="customerselect" lay-filter="customertable"></table>
                            </div>
                            <div  class="layui-tab-item">
                                <table class="layui-table" id="contactselect" lay-filter="contacttable"></table>
                            </div>
                            <div class="layui-tab-item" id="khpooldiv">
                                <table class="layui-table" id="customerpoolselect" lay-filter="customerpooltable"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="layui-row" id="dicustomers" style="display:none;">
    <div class="layui-col-md10 associated-form">
        <form class="layui-form layui-from-pane" action="" style="margin-top:20px" id="dicustomers-formid" lay-filter="dicustomers-form">
            <div class="layui-form-item">
                <label class="layui-form-label">新客户业务员</label>
                <div class="layui-input-block" style=" margin-left: 120px;">
                    <select name="customersalesman" id="customersalesman" lay-verify="" lay-search></select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="dicustomerssubmit" id="dicustomerssubmit">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="layui-row" id="autoincreatepool" style="display:none;">
    <div >
        <table class="layui-table" id="autoincreatepooltable" lay-filter="autoincreatepooltable"></table>
    </div>
    <div class="text-center" >
        <button class="layui-btn"  id="autoincreatepoolsubmit" style="margin:auto">关闭</button>
    </div>
</div>

<div class="layui-row" id="shared" style="display:none;">
    <div class="layui-col-md11 associated-form">
        <form class="layui-form layui-from-pane"  style="margin-top:20px" id="share-formid" lay-filter="share-form">
            <div class="layui-form-item" >
                <label class="layui-form-label" style="line-height: 2em;">业务员</label>
                <div class="layui-input-block" style=" margin-left: 120px;">
                    <button class="layui-btn  layui-btn-submit float-right" lay-submit="" lay-filter="sharesubmit" id="sharesubmit">提交</button>
                    <div id="share" class="xm-select-demo" style="width: 260px"></div>

                </div>

            </div>
           <%-- <div class="layui-form-item">
                <div class="layui-input-block" style="text-align: center; padding-top: 50px;">
                    <button class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="sharesubmit" id="sharesubmit">提交</button>
                </div>
            </div>--%>
        </form>
    </div>
</div>

<div class="layui-row" id="transferd" style="display:none;">
    <div class="layui-col-md10 associated-form">
        <form class="layui-form layui-from-pane" style="height: 250px;width: 98%;">
<%--            <div class="layui-form-item">--%>
<%--                <label class="layui-form-label">业务员</label>--%>
<%--                <div class="layui-input-block" style=" margin-left: 120px;">--%>
<%--                    <div id="transfer" class="xm-select-demo"></div>--%>
<%--                </div>--%>
<%--            </div>--%>
            <div class="layui-inline">
                <label class="layui-form-label">所属业务员</label>
                <div class="layui-input-inline">
                    <select id="salesmanCode" name="salesmanCode" lay-search>
                        <option value=""></option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item" style="position: absolute;bottom: 40px;right: 10px;">
                <div class="layui-input-block">
                    <button type="reset" class="layui-btn  layui-btn-submit ">重置</button>
                    <button class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="transferSubmit" id="transferSubmit">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>


<div class="layui-row" id="setCustomerType" style="display:none;">
    <div class="layui-col-md11 associated-form">
        <form class="layui-form layui-from-pane"  style="margin-top:20px">
            <div class="layui-form-item" >
                <label class="layui-form-label" style="line-height: 2em;">客户类型</label>
                <div class="layui-input-block" style=" margin-left: 120px;">
                    <button class="layui-btn  layui-btn-submit float-right" lay-submit="" lay-filter="setCustomerTypeSubmit">提交</button>
                    <div class="layui-input-inline">
                        <select id="customerType" name="customerType" lay-search>
                            <option value=""></option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<%--<script type="text/html" id="autoincreatepooltableTool">
    <input class="text layui-input" type="text" name="cucustomers" id="" autocomplete="off" placeholder="">

</script>--%>
<%--<script type="text/html" id="customertoolbar">--%>
<%--<div id="customertoolbar">
        <button class="layui-btn layui-btn-sm" data-type="getCheckData" lay-event="new">新增</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger"  lay-event="delet">删除</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger"  lay-event="shared">共享</button>

        <div class="layui-inline">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-inline" style="width: 240px">
                <div id="cucustomerstype2" class="xm-select-demo"></div>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">所属业务员</label>
            <div class="layui-input-inline" style="width: 200px">
                <div id="salesman" class="xm-select-demo"></div>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input class="text layui-input" type="text" name="cucustomers" id="cucustomers" autocomplete="off" placeholder="">
            </div>
        </div>

        <button class="layui-btn layui-btn-sm" lay-event="searchs" style="margin-left: 10px">搜索</button>
        <button class="layui-btn layui-btn-sm" lay-event="publicpool"  id="addpubpool">加入公共池</button>
</div>--%>
<%--</script>--%>

<script type="text/html" id="customerup">
             <%--  <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="customerup">修改</a>--%>
<%--             {{# if (d.processid ===null){}}--%>
<%--                 <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="customerup">修改</a>--%>
<%--            &lt;%&ndash; {{#  } else { }}--%>
<%--               <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="customerup">修改2</a>&ndash;%&gt;--%>
<%--             {{#}}}--%>

             {{# if (d.spstatus =="1" || d.spstatus =="3"){}}
                <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="customerup">修改</a>
             {{#}}}

             {{# if (d.status ==="B"){}}
                 {{# if (d.spstatus =="3"){}}
                     <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="cacleB">取消黑名单</a>
                 {{#}}}
             {{#}}}
             {{# if (d.status !="B"){}}
                {{# if (d.spstatus =="3"){}}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="addB">加入黑名单</a>
                {{#}}}
             {{#}}}

             {{# if (isMarketingDirector){}}
                 {{# if (d.spstatus =="2"){}}
                     <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="through">审批通过</a>
                 {{#}}}
                 {{# if (d.spstatus =="2" || d.spstatus =="3"){}}
                     <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="backtothe">审批退回</a>
                 {{#}}}
             {{#}}}

             {{# if (!isMarketingDirector){}}
                 {{# if (d.spstatus =="2"){}}
                    <cite>审批中</cite>
                 {{#}}}
             {{#}}}

             {{# if (d.spstatus =="1"){}}
                <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="submits">提交审批</a>
             {{#}}}
</script>

<script type="text/html" id="contactquerytoolbar">
    <div class="layui-inline">
        <label class="layui-form-label">联系人信息</label>
        <div class="layui-input-inline">
            <input class="text layui-input" type="text" name="contactinfo" id="contactinfo" autocomplete="off" placeholder="">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input class="text layui-input" type="text" name="contactemail" id="contactemail" autocomplete="off" placeholder="">
        </div>
    </div>
    <button class="layui-btn layui-btn-sm" lay-event="searchs" style="margin-left: 10px">搜索</button>
    <button class="layui-btn layui-btn-sm" lay-event="clear" style="margin-left: 10px" >重置</button>
</script>

<script type="text/html" id="commonclienttoolbar">

        <button class="layui-btn layui-btn-sm" data-type="getCheckData" lay-event="setcustomer">设为自己的客户</button>
        <button class="layui-btn layui-btn-sm"  lay-event="dicustomers">分配客户</button>
        <div class="layui-inline">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-inline">
                <div class="layui-input-inline" style="width: 240px">
                    <div id="cucustomerstype22" class="xm-select-demo"></div>
                </div>

            </div>
        </div>


        <div class="layui-inline">
            <label class="layui-form-label">信息</label>
            <div class="layui-input-inline">
                <input class="text layui-input" type="text" name="cocustomersinfo" id="cocustomersinfo" autocomplete="off" placeholder="">
            </div>
        </div>
      <%--  <div class="layui-inline">
            <label class="layui-form-label">天数</label>
            <div class="layui-input-inline">
                <input class="text layui-input" type="text" name="days" id="days" autocomplete="off" placeholder="">
            </div>
        </div>--%>
        <div class="layui-inline">
            <button class="layui-btn layui-btn-sm" lay-event="searchs" style="margin-left: 10px">搜索</button>
        </div>
        <%--<div class="layui-inline" id="butDisplayTwo" style="display: none;float: right;right: 830px;">
            <button class="layui-btn layui-btn-sm" lay-event="searchs" style="margin-left: 10px">搜索</button>
            <button class="layui-btn layui-btn-sm" lay-event="insertpublic" style="margin-left: 10px">自动加入公共池</button>
            <button class="layui-btn layui-btn-sm" lay-event="potentialCustomerNotExport" style="margin-left: 10px">潜在客户360天未成单</button>
            <button class="layui-btn layui-btn-sm" lay-event="potentialCustomerLastExport" style="margin-left: 10px">距上次成单360天</button>
        </div>--%>
</script>
<%@ include file="../tpl/foot.jsp"%>
<script src="statics/js/BasicData/customercenter.js"></script>